package com.cskaoyan.javase._8loop;

/**
 * 1. 打印以下图案
 * > #
 * > ##
 * > ###
 * > ####
 * > #####
 *
 * 2. 打印九九乘法表
 *
 * @since 11:20
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {

        // 嵌套for打印图案,外层控制行数,内层控制列数
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print("#");
            }
            System.out.println();
        }

        System.out.println("-------------------------------");

        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < i + 1; j++) {
                System.out.print("#");
            }
            System.out.println();
        }

        System.out.println("------------------------------------");
        // 循环习惯从0开始,因为数组的下标是从0开始的
        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j < i + 1; j++) {
                System.out.print(i + " * " + j + " = " + (i * j)+ "\t");
            }
            System.out.println();
        }
    }
}
